//
// Created by dave on 18-7-29.
//
#pragma once

#include "../msg_body.h"
#include "../data_utils.h"

class plat_common_resp : public msg_body {
public:
    std::vector<unsigned char> encode() override {
        std::vector<unsigned char> ret;
        write_word(ret, term_seq_no);
        write_word(ret, term_msg_id);
        ret.push_back(result);
        return ret;
    }

    unsigned short get_term_seq_no() { return term_seq_no; }
    void set_term_seq_no(unsigned short term_seq_no) { this->term_seq_no = term_seq_no; }
    unsigned short get_term_msg_id() { return term_msg_id; }
    void set_term_msg_id(unsigned short term_msg_id) { this->term_msg_id = term_msg_id; }
    char get_result() { return result; }
    void set_result(char result) { this->result = result; }

private:
    /// 终端消息流水号
    unsigned short term_seq_no;
    /// 终端消息ID
    unsigned short term_msg_id;
    /// 0：成功／确认，1：失败，2：消息有误，3：不支持，4：报警处理确认
    char result;
};